package top.lshaci.learning.activiti.day2.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

/**
 * ManagerTaskHandler
 *
 * @author lshaci
 * @since 1.0.0
 */
public class ManagerTaskHandler implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        // 获取请假人
        String leaveUser = delegateTask.getVariable("leaveUser", String.class);

        // 获取请假人的经理
        String manager = leaveUser + "经理";

        // 设置任务的办理者
        delegateTask.setAssignee(manager);
    }
}
